<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>移除</title>
    <link rel="stylesheet" href="../../../css/style.css">
</head>
<body>
<div class="container">
    <div class="box2">
        <button id="btnRemove">删除</button>

    </div>

</div>

</body>
<script>

    var btnRemove= document.getElementById('btnRemove');

    btnRemove.onclick=function () {
        var box = this.parentElement;
        var container = box.parentElement;

        container.removeChild(box);
    }

</script>
</html>